package com.kl.model.pojo;

import lombok.Data;

import java.io.Serializable;
import java.util.UUID;

/**
 * @author CC
 * time 2024-05-29
 * description
 */
@Data
public final class GameSetting implements Serializable {
    private static final long serialVersionUID =1L;
    public static final GameSetting INSTANCE = new GameSetting();
    private GameSetting(){
        if (INSTANCE != null) {
            throw new RuntimeException("实例失败!");
        }
    }

    /**
     * 序列化时, 防止反序列化时创建新的对象
     * @return
     */
    private Object readResolve(){
        return INSTANCE;
    }
    /**
     * 敌人数量
     */
    private int enemyNum = 3;
    /**
     * 用户唯一uid
     */
    private final String uid = UUID.randomUUID().toString();



}
